const initalState ={
    num:1
}

export const reducer = (state=initalState,action) => {
    console.log(state,action,'---')
    switch (action.type){
        case 'ADD':
            return {
                num:++action.num
            }
        case 'JIAN':
            return {
                num:--action.num
            }
        default:
        return state;
    }
}